ignore warnings python

55

ignore warnings python -

import warnings
warnings.filterwarnings("ignore")

python suppress warnings in function -

import warnings

def fxn():
    warnings.warn("deprecated", DeprecationWarning)

with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    fxn()

Comments

Submit
0 Comments